import request from "@/utils/request";
import { stringify } from "qs";
import { toFormData } from "@/utils/utils.jsx";

//6.1 快销采购列表
export async function getFmcgpurchasesList(params) {
	return request(`/new-wms/fmcgpurchases/listPage`, { method: "post", data: params, loading: true });
}
// 拿货员列表
export async function queryTakeUserList(params) {
	return request(`/blade-user/childUsers?${stringify(params)}`, { loading: true });
}

export async function getFindSupplierNumPage(params) {
	return request(`/new-wms/fmcgpurchases/findSupplierNumPage?${stringify(params)}`, { loading: true });
}
// 标记异常
export async function uniquecodesMarkExc(params) {
	return request(`/new-wms/uniquecodes/markExc`, {
		method: "post",
		data: params,
		loading: true
	});
}

// 取消标记异常
export async function uniquecodesCancelMarkExc(params) {
	return request(`/new-wms/uniquecodes/cancelMarkExc`, {
		method: "post",
		data: params,
		loading: true
	});
}
// 拿货指派
export async function fmcgpurchasesAppointReceivingClerk(params) {
	return request(`/new-wms/fmcgpurchases/appointReceivingClerk`, {
		method: "post",
		data: params,
		loading: true
	});
}

// 快销采购支付
export async function outboundproductsPay(params) {
	return request(`/new-wms/outboundproducts/pay`, {
		method: "post",
		data: params,
		loading: true
	});
}
// 唯一码配置读取
export async function getUniqueconfigList() {
	return request(`/new-wms/uniqueconfig/list`, { loading: true });
}
// 唯一码打印接口
export async function getPrintTemp(params) {
	return request(`/new-wms/fmcgpurchases/getPrintTemp?${stringify(params)}`, { loading: true });
}
// // 唯一码打印成功后请求
// export async function updatePrintStatus(params) {
// 	return request(`/new-wms/uniquecodes/updatePrint?${stringify(params)}`);
// }

export async function updatePrintStatus(params) {
	return request(`/new-wms/uniquecodes/updatePrint`, {
		method: "post",
		data: params
		// loading: true
	});
}
// 修改唯一码配置
export async function uniqueconfigSubmit(params) {
	return request(`/new-wms/uniqueconfig/submit`, {
		method: "post",
		data: params,
		loading: true
	});
}
// 供应商拿货
export async function fmcgpurchasesUpdateFmcgPurchaseSupplier(params) {
	return request(`/new-wms/fmcgpurchases/updateFmcgPurchaseSupplier`, {
		method: "post",
		data: params,
		loading: true
	});
}

export async function getFmcgpurchaseslistArea() {
	return request(`/new-wms/fmcgpurchases/listArea`, { loading: true });
}

//获取商品唯一码打印数据
export async function getPrintData(params) {
	return request(`/zjf-wms/hiprint/getTakeGoodsPrintData`, {
		method: "post",
		data: params,
		loading: true
	});
}

//获取商品唯一码打印数据(已拿货列表筛选)
export async function queryTakenGoodsPrintData(params) {
	return request(`/zjf-wms/hiprint/getTakenGoodsPrintData`, {
		method: "post",
		data: params,
		loading: true
	});
}

//获取商品唯一码打印数据
export async function getPrintDataByUniqeCode(params) {
	return request(`/zjf-wms/hiprint/getPrintUniqueCodes/uniqueCodes`, {
		method: "post",
		data: params,
		loading: true
	});
}
// 所属仓库
export async function queryBatchWarehouseList(params) {
	return request(`/zjf-wms/client/kx/warehouse/queryBatchWarehouseList?${stringify(params)}`);
}
// 快递公司列表
export async function queryExpressList(params) {
	return request(`/blade-logistics/expresskxerp/expressKv?${stringify(params)}`);
}
//区域编码模糊查询
export async function queryAreaCode(params) {
	return request(`/zjf-wms/storecodesort/selectListByName?${stringify(params)}`);
}

//档口信息
export async function getSupplierInfo(params) {
	return request(`/new-wms/supplierInfo/list`, {
		method: "post",
		data: params,
		loading: true
	});
}


//拿货配置查询
export async function takeFieldSettings(params) {
	return request(`/new-common/takeFieldSettings/detail?${stringify(params)}`);
}

//修改拿货配置
export async function editTakeFieldSettings(params) {
	return request(`/new-common/takeFieldSettings/update?${stringify(params)}`);
}
// 新的修改拿货配置
export async function editTakeFieldSettingsNew(params) {
	return request(`/new-common/takeFieldSettings/new/update`, {
		method: "post",
		data: params,
	});
}

// 保存打印记录
export async function saveCodePrintTask(params) {
	return request(`/new-oms-ec/printTask/saveCodePrintTask`, {
		method: "post",
		data: params,
	});
}

//订单主列表
export function getOrderList(params) {
	return request(`/new-oms-search/esOrder/queryESOrder`, {
		method: "POST",
		data: params
		// baseURL: mockURL,
	});
}
//获取快麦唯一码打印数据
export async function getKuaiMaiPrint(params) {
	return request(`/new-wms/kuaimai/getKuaiMaiCodePrintList`, {
		method: "post",
		data: params,
	});
}

// 店铺打印任务批次推送
export async function batchPushGoods(params) {
	return request(`/new-wms/fmcgpurchases/manualStorePrint`, {
		method: "post",
		data: params,
	});
}

// 取消标记异常-前置弹框获取数据
export async function beforeCancelMarkExc(params) {
	return request(`/new-wms/uniquecodes/beforeCancelMarkExc`, {
		method: "post",
		data: params,
		loading: true
	});
}
//唯一码日志查询
export async function uniqueCodeLog(params) {
	return request(`/new-wms/logs/page?${stringify(params)}`);
}

//不参与重匹配的订单范围详情
export async function againcodeorderstrategyDetail(params) {
	return request(`/new-common/againcodeorderstrategy/detail?${stringify(params)}`);
}

//不参与重匹配的订单范围修改
export async function againcodeorderstrategyUpdate(params) {
	return request(`/new-common/againcodeorderstrategy/update`, {
		method: "post",
		data: params,
	});
}

//参与重匹配的商品范围详情
export async function againcodegoodstrategyDetail(params) {
	return request(`/new-common/againcodegoodsstrategy/detail?${stringify(params)}`);
}

//参与重匹配的商品范围修改
export async function againcodegoodstrategyUpdate(params) {
	return request(`/new-common/againcodegoodsstrategy/update`, {
		method: "post",
		data: params,
	});
}
